package com.lute.model;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class LuteTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		AnnotationConfiguration config = new AnnotationConfiguration();

		// adding classes to config object
		config.addAnnotatedClass(Admin.class);
		config.addAnnotatedClass(Approver.class);
		config.addAnnotatedClass(BusinessUnit.class);
		config.addAnnotatedClass(Client.class);
		config.addAnnotatedClass(ClientAccountingPeriod.class);
		config.addAnnotatedClass(ClientAdmin.class);
		config.addAnnotatedClass(ClientAdminProfile.class);
		config.addAnnotatedClass(ClientCategory.class);
		config.addAnnotatedClass(ClientProfile.class);
		config.addAnnotatedClass(CompanyCategory.class);
		config.addAnnotatedClass(Employee.class);
		config.addAnnotatedClass(EmployeeAccountingPeriod.class);
		config.addAnnotatedClass(EmployeeAccountingPeriodState.class);
		config.addAnnotatedClass(EmployeeEntry.class);
		config.addAnnotatedClass(EmployeeProfile.class);
		config.addAnnotatedClass(NotepadEntry.class);
		config.addAnnotatedClass(Position.class);
		config.addAnnotatedClass(Role.class);
		config.addAnnotatedClass(User.class);
		
		
		// telling hibernate to configure itself using XML file stored in build classpath
		config.configure("hibernate.cfg.xml");
		
		// update schema configured in XML file
		new SchemaExport(config).create(true, true);
		
		SessionFactory factory = config.buildSessionFactory();
		Session session = factory.getCurrentSession();
		session.beginTransaction();
		
		/*
		 * CLIENT CATEGORY + COMPANY CATEGORY
		 */
		ClientCategory clientCatBusinessTrip = new ClientCategory();
		clientCatBusinessTrip.setName(ClientHoursCategory.BUSINESSTRIP.toString());
		
		ClientCategory clientCatContractorTimeOff = new ClientCategory();
		clientCatContractorTimeOff.setName(ClientHoursCategory.CONTRACTORTIMEOFF.toString());
		
		ClientCategory clientCatNormalTime = new ClientCategory();
		clientCatNormalTime.setName(ClientHoursCategory.NORMALTIME.toString());
		
		ClientCategory clientCatOverTime = new ClientCategory();
		clientCatOverTime.setName(ClientHoursCategory.OVERTIME.toString());
		
		ClientCategory clientCatTraining = new ClientCategory();
		clientCatTraining.setName(ClientHoursCategory.TRAINING.toString());
		

		
		
		CompanyCategory companyCategory1 = new CompanyCategory();
		companyCategory1.setName(CompanyHoursCategory.NATIONAL_HOLIDAY.toString());
		
		CompanyCategory companyCategory2 = new CompanyCategory();
		companyCategory2.setName(CompanyHoursCategory.BUSINESS_TRIP_CLIENT.toString());
		
		CompanyCategory companyCategory3 = new CompanyCategory();
		companyCategory3.setName(CompanyHoursCategory.BUSINESS_TRIP_COMPANY.toString());
		
		CompanyCategory companyCategory4 = new CompanyCategory();
		companyCategory4.setName(CompanyHoursCategory.MATERNITY_LEAVE.toString());
		
		CompanyCategory companyCategory5 = new CompanyCategory();
		companyCategory5.setName(CompanyHoursCategory.OVERTIME_CLIENT.toString());
		
		CompanyCategory companyCategory6 = new CompanyCategory();
		companyCategory6.setName(CompanyHoursCategory.OVERTIME_COMPANY.toString());
		
		CompanyCategory companyCategory7 = new CompanyCategory();
		companyCategory7.setName(CompanyHoursCategory.PATERNITY_LEAVE.toString());
		
		CompanyCategory companyCategory8 = new CompanyCategory();
		companyCategory8.setName(CompanyHoursCategory.SICK_LEAVE.toString());
		
		CompanyCategory companyCategory9 = new CompanyCategory();
		companyCategory9.setName(CompanyHoursCategory.TRAINING_CLIENT.toString());
		
		CompanyCategory companyCategory10 = new CompanyCategory();
		companyCategory10.setName(CompanyHoursCategory.TRAINING_COMPANY.toString());
		
		CompanyCategory companyCategory11 = new CompanyCategory();
		companyCategory11.setName(CompanyHoursCategory.UNDEFINED.toString());
		
		CompanyCategory companyCategory12 = new CompanyCategory();
		companyCategory12.setName(CompanyHoursCategory.VACATION.toString());
		
		CompanyCategory companyCategory13 = new CompanyCategory();
		companyCategory13.setName(CompanyHoursCategory.WORK_CLIENT.toString());
		
		CompanyCategory companyCategory14 = new CompanyCategory();
		companyCategory14.setName(CompanyHoursCategory.WORK_COMPANY.toString());
		
		companyCategory1.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory2.getClientCategories().add(clientCatBusinessTrip);
		companyCategory3.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory4.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory5.getClientCategories().add(clientCatOverTime);
		companyCategory6.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory7.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory8.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory9.getClientCategories().add(clientCatTraining);
		companyCategory10.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory11.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory12.getClientCategories().add(clientCatContractorTimeOff);
		companyCategory13.getClientCategories().add(clientCatNormalTime);
		companyCategory14.getClientCategories().add(clientCatContractorTimeOff);
		
		clientCatBusinessTrip.getCompanyCategories().add(companyCategory2);
		clientCatNormalTime.getCompanyCategories().add(companyCategory13);
		clientCatOverTime.getCompanyCategories().add(companyCategory5);
		clientCatTraining.getCompanyCategories().add(companyCategory9);
		
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory1);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory3);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory4);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory6);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory7);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory8);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory10);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory11);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory12);
		clientCatContractorTimeOff.getCompanyCategories().add(companyCategory14);
		
		session.save(clientCatBusinessTrip);
		session.save(clientCatContractorTimeOff);
		session.save(clientCatNormalTime);
		session.save(clientCatOverTime);
		session.save(clientCatTraining);
		session.save(companyCategory1);
		session.save(companyCategory2);
		session.save(companyCategory3);
		session.save(companyCategory4);
		session.save(companyCategory5);
		session.save(companyCategory6);
		session.save(companyCategory7);
		session.save(companyCategory8);
		session.save(companyCategory9);
		session.save(companyCategory10);
		session.save(companyCategory11);
		session.save(companyCategory12);
		session.save(companyCategory13);
		session.save(companyCategory14);
		/*
		 * END OF -------------- CLIENT CATEGORY + COMPANY CATEGORY
		 */


		/*
		 * ROLE
		 */
		Role roleEmployeeTest = new Role();
		roleEmployeeTest.setName("employeeTest");
		session.save(roleEmployeeTest);

		Role roleApprover = new Role();
		roleApprover.setName("approver");
		session.save(roleApprover);

		Role roleClientAdmin = new Role();
		roleClientAdmin.setName("clientAdmin");
		session.save(roleClientAdmin);
			
		Role roleAdmin = new Role();
		roleAdmin.setName("admin");
		session.save(roleAdmin);
			
		Role roleEmployee = new Role();
		roleEmployee.setName("employee");
		session.save(roleEmployee);
		/*
		 * END OF -------------- ROLE
		 */


		/*
		 * POSITION
		 */
		Position position1 = new Position();
		position1.setName(PositionName.BUSINESS_ANALYST.toString());
		position1.setCreativity_percentage(PositionName.BUSINESS_ANALYST.getPercentage());
		session.save(position1);
		
		Position position2 = new Position();
		position2.setName(PositionName.DEVELOPER.toString());
		position2.setCreativity_percentage(PositionName.DEVELOPER.getPercentage());
		session.save(position2);

		Position position3 = new Position();
		position3.setName(PositionName.QA.toString());
		position3.setCreativity_percentage(PositionName.QA.getPercentage());
		session.save(position3);
		
		Position position4 = new Position();
		position4.setName(PositionName.SUPPORT.toString());
		position4.setCreativity_percentage(PositionName.SUPPORT.getPercentage());
		session.save(position4);

		/*
		 * END OF -------------- POSITION
		 */
		

		/*
		 * CLIENT
		 */
		Client client1 = new Client();
		client1.setName("Client1");
		session.save(client1);
			
		Client client2 = new Client();
		client2.setName("Client2");
		session.save(client2);
			
		Client client3 = new Client();
		client3.setName("Client3");
		session.save(client3);
			
		Client client4 = new Client();
		client4.setName("Client4");
		session.save(client4);

		Client client5 = new Client();
		client5.setName("Client5");
		session.save(client5);
		/*
		 * END OF -------------- CLIENT
		 */
		
		
		
		/*
		 * BUSINESS UNIT
		 */
		BusinessUnit businessUnit1 = new BusinessUnit();
		businessUnit1.setName("Client1 BU1");
		businessUnit1.setClient(client1);
		client1.getBusiness_units().add(businessUnit1);
		session.save(businessUnit1);
		
		BusinessUnit businessUnit2 = new BusinessUnit();
		businessUnit2.setName("Client1 BU2");
		businessUnit2.setClient(client1);
		client1.getBusiness_units().add(businessUnit2);
		session.save(businessUnit2);
		
		BusinessUnit businessUnit3 = new BusinessUnit();
		businessUnit3.setName("Client1 BU3");
		businessUnit3.setClient(client1);
		client1.getBusiness_units().add(businessUnit3);
		session.save(businessUnit3);
		
		BusinessUnit businessUnit4 = new BusinessUnit();
		businessUnit4.setName("Client2 BU1");
		businessUnit4.setClient(client2);
		client2.getBusiness_units().add(businessUnit4);
		session.save(businessUnit4);

		BusinessUnit businessUnit5 = new BusinessUnit();
		businessUnit5.setName("Client2 BU2");
		businessUnit5.setClient(client2);
		client2.getBusiness_units().add(businessUnit5);
		session.save(businessUnit5);

		BusinessUnit businessUnit6 = new BusinessUnit();
		businessUnit6.setName("Client3 BU1");
		businessUnit6.setClient(client2);
		client2.getBusiness_units().add(businessUnit6);
		session.save(businessUnit6);

		BusinessUnit businessUnit7 = new BusinessUnit();
		businessUnit7.setName("Client3 BU2");
		businessUnit7.setClient(client2);
		client2.getBusiness_units().add(businessUnit7);
		session.save(businessUnit7);

		BusinessUnit businessUnit8 = new BusinessUnit();
		businessUnit8.setName("Client4 BU1");
		businessUnit8.setClient(client3);
		client3.getBusiness_units().add(businessUnit8);
		session.save(businessUnit8);

		BusinessUnit businessUnit9 = new BusinessUnit();
		businessUnit9.setName("Client4 BU2");
		businessUnit9.setClient(client3);
		client3.getBusiness_units().add(businessUnit9);
		session.save(businessUnit9);

		BusinessUnit businessUnit10 = new BusinessUnit();
		businessUnit10.setName("Client4 BU3");
		businessUnit10.setClient(client3);
		client3.getBusiness_units().add(businessUnit10);
		session.save(businessUnit10);

		BusinessUnit businessUnit11 = new BusinessUnit();
		businessUnit11.setName("Client4 BU4");
		businessUnit11.setClient(client4);
		client4.getBusiness_units().add(businessUnit11);
		session.save(businessUnit11);

		BusinessUnit businessUnit12 = new BusinessUnit();
		businessUnit12.setName("Client5 BU1");
		businessUnit12.setClient(client5);
		client5.getBusiness_units().add(businessUnit12);
		session.save(businessUnit12);

		BusinessUnit businessUnit13 = new BusinessUnit();
		businessUnit13.setName("Client5 BU2");
		businessUnit13.setClient(client5);
		client5.getBusiness_units().add(businessUnit13);
		session.save(businessUnit13);
		/*
		 * END OF -------------- BUSINESS UNIT
		 */

		
		/*
		 * CLIENT ADMIN 1st + CLIENT ADMIN PROFILE
		 */
		ClientAdmin clientAdmin1 =  new ClientAdmin();
		clientAdmin1.setLogin("jko");
		clientAdmin1.setRole(roleClientAdmin);
		clientAdmin1.setEmail("jankowalski@gmail.com");
		clientAdmin1.setFirst_name("Jan");
		clientAdmin1.setLast_name("Kowalski");

		ClientAdmin clientAdmin2 =  new ClientAdmin();
		clientAdmin2.setLogin("alu");
		clientAdmin2.setRole(roleClientAdmin);
		clientAdmin2.setEmail("adam.ludwikowski@gmail.com");
		clientAdmin2.setFirst_name("Adam");
		clientAdmin2.setLast_name("Ludwikowski");

		ClientAdmin clientAdmin3 =  new ClientAdmin();
		clientAdmin3.setLogin("rmi");
		clientAdmin3.setRole(roleClientAdmin);
		clientAdmin3.setEmail("rafalmigalski@gmail.com");
		clientAdmin3.setFirst_name("Rafal");
		clientAdmin3.setLast_name("Migalski");
		
		ClientAdminProfile clientAdminProfile1 = new ClientAdminProfile();
		clientAdminProfile1.setEmail("jankowalski@gmail.com");
		clientAdminProfile1.setClientAdmin(clientAdmin1);
		clientAdminProfile1.getClients().add(client1);
		clientAdminProfile1.getClients().add(client2);
		clientAdminProfile1.getClients().add(client3);
		
		ClientAdminProfile clientAdminProfile2 = new ClientAdminProfile();
		clientAdminProfile2.setEmail("adam.ludwikowski@gmail.com");
		clientAdminProfile2.setClientAdmin(clientAdmin2);
		clientAdminProfile2.getClients().add(client3);
		clientAdminProfile2.getClients().add(client4);
		
		ClientAdminProfile clientAdminProfile3 = new ClientAdminProfile();
		clientAdminProfile3.setEmail("rafalmigalski@gmail.com");
		clientAdminProfile3.setClientAdmin(clientAdmin3);
		clientAdminProfile3.getClients().add(client1);
		clientAdminProfile3.getClients().add(client5);
		
		session.save(clientAdmin1);
		session.save(clientAdmin2);
		session.save(clientAdmin3);
		session.save(clientAdminProfile1);
		session.save(clientAdminProfile2);
		session.save(clientAdminProfile3);
		/*
		 * END OF -------------- CLIENT ADMIN + CLIENT ADMIN PROFILE
		 */

		/*
		 * NOTEPAD ENTRY
		 */
			
		// NotepadEntries for EMPLOYEE1
		NotepadEntry notepadEntry1Employee1 = new NotepadEntry();
		notepadEntry1Employee1.setDate(new GregorianCalendar(2013,8,01));
		notepadEntry1Employee1.setHours(8);
		notepadEntry1Employee1.setCreativeHours(0);
		notepadEntry1Employee1.setCompanyCategory(companyCategory8);
		session.save(notepadEntry1Employee1);
			
		NotepadEntry notepadEntry2Employee1 = new NotepadEntry();
		notepadEntry2Employee1.setDate(new GregorianCalendar(2013,8,02));
		notepadEntry2Employee1.setHours(8);
		notepadEntry2Employee1.setCreativeHours(0);
		notepadEntry2Employee1.setCompanyCategory(companyCategory8);
		session.save(notepadEntry2Employee1);

		NotepadEntry notepadEntry3Employee1 = new NotepadEntry();
		notepadEntry3Employee1.setDate(new GregorianCalendar(2013,8,05));
		notepadEntry3Employee1.setHours(8);
		notepadEntry3Employee1.setCreativeHours(8);
		notepadEntry3Employee1.setCompanyCategory(companyCategory13);
		session.save(notepadEntry3Employee1);

		NotepadEntry notepadEntry4Employee1 = new NotepadEntry();
		notepadEntry4Employee1.setDate(new GregorianCalendar(2013,8,05));
		notepadEntry4Employee1.setHours(2);
		notepadEntry4Employee1.setCreativeHours(2);
		notepadEntry4Employee1.setCompanyCategory(companyCategory5);
		session.save(notepadEntry4Employee1);
			
		NotepadEntry notepadEntry5Employee1 = new NotepadEntry();
		notepadEntry5Employee1.setDate(new GregorianCalendar(2013,8,06));
		notepadEntry5Employee1.setHours(8);
		notepadEntry5Employee1.setCreativeHours(8);
		notepadEntry5Employee1.setCompanyCategory(companyCategory13);
		session.save(notepadEntry5Employee1);

		NotepadEntry notepadEntry6Employee1 = new NotepadEntry();
		notepadEntry6Employee1.setDate(new GregorianCalendar(2013,8,06));
		notepadEntry6Employee1.setHours(2);
		notepadEntry6Employee1.setCreativeHours(2);
		notepadEntry6Employee1.setCompanyCategory(companyCategory5);
		session.save(notepadEntry6Employee1);

		NotepadEntry notepadEntry7Employee1 = new NotepadEntry();
		notepadEntry7Employee1.setDate(new GregorianCalendar(2013,8,07));
		notepadEntry7Employee1.setHours(8);
		notepadEntry7Employee1.setCreativeHours(6);
		notepadEntry7Employee1.setCompanyCategory(companyCategory13);
		session.save(notepadEntry7Employee1);

		NotepadEntry notepadEntry8Employee1 = new NotepadEntry();
		notepadEntry8Employee1.setDate(new GregorianCalendar(2013,8,8));
		notepadEntry8Employee1.setHours(8);
		notepadEntry8Employee1.setCreativeHours(0);
		notepadEntry8Employee1.setCompanyCategory(companyCategory8);
		session.save(notepadEntry8Employee1);

		NotepadEntry notepadEntry9Employee1 = new NotepadEntry();
		notepadEntry9Employee1.setDate(new GregorianCalendar(2013,8,9));
		notepadEntry9Employee1.setHours(8);
		notepadEntry9Employee1.setCreativeHours(0);
		notepadEntry9Employee1.setCompanyCategory(companyCategory8);
		session.save(notepadEntry9Employee1);

		// NotepadEntries for EMPLOYEE2
		NotepadEntry notepadEntry1Employee2 = new NotepadEntry();
		notepadEntry1Employee2.setDate(new GregorianCalendar(2013,8,01));
		notepadEntry1Employee2.setHours(8);
		notepadEntry1Employee2.setCreativeHours(1);
		notepadEntry1Employee2.setCompanyCategory(companyCategory3);
		session.save(notepadEntry1Employee2);
		
		NotepadEntry notepadEntry2Employee2 = new NotepadEntry();
		notepadEntry2Employee2.setDate(new GregorianCalendar(2013,8,02));
		notepadEntry2Employee2.setHours(8);
		notepadEntry2Employee2.setCreativeHours(1);
		notepadEntry2Employee2.setCompanyCategory(companyCategory10);
		session.save(notepadEntry2Employee2);
		
		NotepadEntry notepadEntry3Employee2 = new NotepadEntry();
		notepadEntry3Employee2.setDate(new GregorianCalendar(2013,8,05));
		notepadEntry3Employee2.setHours(8);
		notepadEntry3Employee2.setCreativeHours(8);
		notepadEntry3Employee2.setCompanyCategory(companyCategory14);
		session.save(notepadEntry3Employee2);
		
		NotepadEntry notepadEntry4Employee2 = new NotepadEntry();
		notepadEntry4Employee2.setDate(new GregorianCalendar(2013,8,05));
		notepadEntry4Employee2.setHours(4);
		notepadEntry4Employee2.setCreativeHours(0);
		notepadEntry4Employee2.setCompanyCategory(companyCategory3);
		session.save(notepadEntry4Employee2);
		
		NotepadEntry notepadEntry5Employee2 = new NotepadEntry();
		notepadEntry5Employee2.setDate(new GregorianCalendar(2013,8,06));
		notepadEntry5Employee2.setHours(8);
		notepadEntry5Employee2.setCreativeHours(8);
		notepadEntry5Employee2.setCompanyCategory(companyCategory13);
		session.save(notepadEntry5Employee2);
		
		NotepadEntry notepadEntry6Employee2 = new NotepadEntry();
		notepadEntry6Employee2.setDate(new GregorianCalendar(2013,8,06));
		notepadEntry6Employee2.setHours(2);
		notepadEntry6Employee2.setCreativeHours(2);
		notepadEntry6Employee2.setCompanyCategory(companyCategory10);
		session.save(notepadEntry6Employee2);
		
		NotepadEntry notepadEntry7Employee2 = new NotepadEntry();
		notepadEntry7Employee2.setDate(new GregorianCalendar(2013,8,07));
		notepadEntry7Employee2.setHours(8);
		notepadEntry7Employee2.setCreativeHours(7);
		notepadEntry7Employee2.setCompanyCategory(companyCategory14);
		session.save(notepadEntry7Employee2);
		
		NotepadEntry notepadEntry8Employee2 = new NotepadEntry();
		notepadEntry8Employee2.setDate(new GregorianCalendar(2013,8,8));
		notepadEntry8Employee2.setHours(8);
		notepadEntry8Employee2.setCreativeHours(8);
		notepadEntry8Employee2.setCompanyCategory(companyCategory13);
		session.save(notepadEntry8Employee2);
		
		NotepadEntry notepadEntry9Employee2 = new NotepadEntry();
		notepadEntry9Employee2.setDate(new GregorianCalendar(2013,8,9));
		notepadEntry9Employee2.setHours(8);
		notepadEntry9Employee2.setCreativeHours(0);
		notepadEntry9Employee2.setCompanyCategory(companyCategory14);
		session.save(notepadEntry9Employee2);

		// NotepadEntries for EMPLOYEE3
		NotepadEntry notepadEntry1Employee3 = new NotepadEntry();
		notepadEntry1Employee3.setDate(new GregorianCalendar(2013,8,01));
		notepadEntry1Employee3.setHours(8);
		notepadEntry1Employee3.setCreativeHours(0);
		notepadEntry1Employee3.setCompanyCategory(companyCategory8);
		session.save(notepadEntry1Employee3);
		
		NotepadEntry notepadEntry2Employee3 = new NotepadEntry();
		notepadEntry2Employee3.setDate(new GregorianCalendar(2013,8,02));
		notepadEntry2Employee3.setHours(8);
		notepadEntry2Employee3.setCreativeHours(1);
		notepadEntry2Employee3.setCompanyCategory(companyCategory12);
		session.save(notepadEntry2Employee3);
		
		NotepadEntry notepadEntry3Employee3 = new NotepadEntry();
		notepadEntry3Employee3.setDate(new GregorianCalendar(2013,8,05));
		notepadEntry3Employee3.setHours(8);
		notepadEntry3Employee3.setCreativeHours(0);
		notepadEntry3Employee3.setCompanyCategory(companyCategory7);
		session.save(notepadEntry3Employee3);
		
		NotepadEntry notepadEntry4Employee3 = new NotepadEntry();
		notepadEntry4Employee3.setDate(new GregorianCalendar(2013,8,06));
		notepadEntry4Employee3.setHours(8);
		notepadEntry4Employee3.setCreativeHours(0);
		notepadEntry4Employee3.setCompanyCategory(companyCategory7);
		session.save(notepadEntry4Employee3);
		
		NotepadEntry notepadEntry5Employee3 = new NotepadEntry();
		notepadEntry5Employee3.setDate(new GregorianCalendar(2013,8,07));
		notepadEntry5Employee3.setHours(8);
		notepadEntry5Employee3.setCreativeHours(0);
		notepadEntry5Employee3.setCompanyCategory(companyCategory7);
		session.save(notepadEntry5Employee3);
		
		NotepadEntry notepadEntry6Employee3 = new NotepadEntry();
		notepadEntry6Employee3.setDate(new GregorianCalendar(2013,8,8));
		notepadEntry6Employee3.setHours(8);
		notepadEntry6Employee3.setCreativeHours(8);
		notepadEntry6Employee3.setCompanyCategory(companyCategory14);
		session.save(notepadEntry6Employee3);
		
		NotepadEntry notepadEntry7Employee3 = new NotepadEntry();
		notepadEntry7Employee3.setDate(new GregorianCalendar(2013,8,9));
		notepadEntry7Employee3.setHours(8);
		notepadEntry7Employee3.setCreativeHours(7);
		notepadEntry7Employee3.setCompanyCategory(companyCategory14);
		session.save(notepadEntry7Employee3);
		
		NotepadEntry notepadEntry8Employee3 = new NotepadEntry();
		notepadEntry8Employee3.setDate(new GregorianCalendar(2013,8,12));
		notepadEntry8Employee3.setHours(8);
		notepadEntry8Employee3.setCreativeHours(0);
		notepadEntry8Employee3.setCompanyCategory(companyCategory12);
		session.save(notepadEntry8Employee3);
		
		NotepadEntry notepadEntry9Employee3 = new NotepadEntry();
		notepadEntry9Employee3.setDate(new GregorianCalendar(2013,8,13));
		notepadEntry9Employee3.setHours(8);
		notepadEntry9Employee3.setCreativeHours(0);
		notepadEntry9Employee3.setCompanyCategory(companyCategory8);
		session.save(notepadEntry9Employee3);

		// NotepadEntries for EMPLOYEE4
		NotepadEntry notepadEntry1Employee4 = new NotepadEntry();
		notepadEntry1Employee4.setDate(new GregorianCalendar(2013,8,01));
		notepadEntry1Employee4.setHours(8);
		notepadEntry1Employee4.setCreativeHours(5);
		notepadEntry1Employee4.setCompanyCategory(companyCategory1);
		session.save(notepadEntry1Employee4);
		
		NotepadEntry notepadEntry2Employee4 = new NotepadEntry();
		notepadEntry2Employee4.setDate(new GregorianCalendar(2013,8,02));
		notepadEntry2Employee4.setHours(8);
		notepadEntry2Employee4.setCreativeHours(1);
		notepadEntry2Employee4.setCompanyCategory(companyCategory1);
		session.save(notepadEntry2Employee4);
		
		NotepadEntry notepadEntry3Employee4 = new NotepadEntry();
		notepadEntry3Employee4.setDate(new GregorianCalendar(2013,8,05));
		notepadEntry3Employee4.setHours(8);
		notepadEntry3Employee4.setCreativeHours(2);
		notepadEntry3Employee4.setCompanyCategory(companyCategory2);
		session.save(notepadEntry3Employee4);
		
		NotepadEntry notepadEntry4Employee4 = new NotepadEntry();
		notepadEntry4Employee4.setDate(new GregorianCalendar(2013,8,06));
		notepadEntry4Employee4.setHours(8);
		notepadEntry4Employee4.setCreativeHours(0);
		notepadEntry4Employee4.setCompanyCategory(companyCategory3);
		session.save(notepadEntry4Employee4);
		
		NotepadEntry notepadEntry5Employee4 = new NotepadEntry();
		notepadEntry5Employee4.setDate(new GregorianCalendar(2013,8,07));
		notepadEntry5Employee4.setHours(8);
		notepadEntry5Employee4.setCreativeHours(0);
		notepadEntry5Employee4.setCompanyCategory(companyCategory3);
		session.save(notepadEntry5Employee4);
		
		NotepadEntry notepadEntry6Employee4 = new NotepadEntry();
		notepadEntry6Employee4.setDate(new GregorianCalendar(2013,8,8));
		notepadEntry6Employee4.setHours(8);
		notepadEntry6Employee4.setCreativeHours(8);
		notepadEntry6Employee4.setCompanyCategory(companyCategory1);
		session.save(notepadEntry6Employee4);
		
		NotepadEntry notepadEntry7Employee4 = new NotepadEntry();
		notepadEntry7Employee4.setDate(new GregorianCalendar(2013,8,9));
		notepadEntry7Employee4.setHours(4);
		notepadEntry7Employee4.setCreativeHours(0);
		notepadEntry7Employee4.setCompanyCategory(companyCategory2);
		session.save(notepadEntry7Employee4);
		
		NotepadEntry notepadEntry8Employee4 = new NotepadEntry();
		notepadEntry8Employee4.setDate(new GregorianCalendar(2013,8,9));
		notepadEntry8Employee4.setHours(4);
		notepadEntry8Employee4.setCreativeHours(0);
		notepadEntry8Employee4.setCompanyCategory(companyCategory3);
		session.save(notepadEntry8Employee4);
		
		NotepadEntry notepadEntry9Employee4 = new NotepadEntry();
		notepadEntry9Employee4.setDate(new GregorianCalendar(2013,8,9));
		notepadEntry9Employee4.setHours(8);
		notepadEntry9Employee4.setCreativeHours(0);
		notepadEntry9Employee4.setCompanyCategory(companyCategory8);
		session.save(notepadEntry9Employee4);

		/*
		 * END OF -------------- NOTEPAD ENTRY
		 */

		
		/*
		 * EMPLOYEE ENTRY
		 */
		
		// NotepadEntries for EMPLOYEE1
		EmployeeEntry employeeEntry1Employee1 = new EmployeeEntry();
		employeeEntry1Employee1.setDate(new GregorianCalendar(2013,8,01));
		employeeEntry1Employee1.setHours(8);
		employeeEntry1Employee1.setCreativeHours(0);
		employeeEntry1Employee1.setCompanyCategory(companyCategory8);
		session.save(employeeEntry1Employee1);
		
		EmployeeEntry employeeEntry2Employee1 = new EmployeeEntry();
		employeeEntry2Employee1.setDate(new GregorianCalendar(2013,8,02));
		employeeEntry2Employee1.setHours(8);
		employeeEntry2Employee1.setCreativeHours(0);
		employeeEntry2Employee1.setCompanyCategory(companyCategory8);
		session.save(employeeEntry2Employee1);
		
		EmployeeEntry employeeEntry3Employee1 = new EmployeeEntry();
		employeeEntry3Employee1.setDate(new GregorianCalendar(2013,8,05));
		employeeEntry3Employee1.setHours(8);
		employeeEntry3Employee1.setCreativeHours(8);
		employeeEntry3Employee1.setCompanyCategory(companyCategory13);
		session.save(employeeEntry3Employee1);
		
		EmployeeEntry employeeEntry4Employee1 = new EmployeeEntry();
		employeeEntry4Employee1.setDate(new GregorianCalendar(2013,8,05));
		employeeEntry4Employee1.setHours(2);
		employeeEntry4Employee1.setCreativeHours(2);
		employeeEntry4Employee1.setCompanyCategory(companyCategory5);
		session.save(employeeEntry4Employee1);
		
		EmployeeEntry employeeEntry5Employee1 = new EmployeeEntry();
		employeeEntry5Employee1.setDate(new GregorianCalendar(2013,8,06));
		employeeEntry5Employee1.setHours(8);
		employeeEntry5Employee1.setCreativeHours(8);
		employeeEntry5Employee1.setCompanyCategory(companyCategory13);
		session.save(employeeEntry5Employee1);
		
		EmployeeEntry employeeEntry6Employee1 = new EmployeeEntry();
		employeeEntry6Employee1.setDate(new GregorianCalendar(2013,8,06));
		employeeEntry6Employee1.setHours(2);
		employeeEntry6Employee1.setCreativeHours(2);
		employeeEntry6Employee1.setCompanyCategory(companyCategory5);
		session.save(employeeEntry6Employee1);
		
		EmployeeEntry employeeEntry7Employee1 = new EmployeeEntry();
		employeeEntry7Employee1.setDate(new GregorianCalendar(2013,8,07));
		employeeEntry7Employee1.setHours(8);
		employeeEntry7Employee1.setCreativeHours(6);
		employeeEntry7Employee1.setCompanyCategory(companyCategory13);
		session.save(employeeEntry7Employee1);
		
		EmployeeEntry employeeEntry8Employee1 = new EmployeeEntry();
		employeeEntry8Employee1.setDate(new GregorianCalendar(2013,8,8));
		employeeEntry8Employee1.setHours(8);
		employeeEntry8Employee1.setCreativeHours(0);
		employeeEntry8Employee1.setCompanyCategory(companyCategory8);
		session.save(employeeEntry8Employee1);
		
		EmployeeEntry employeeEntry9Employee1 = new EmployeeEntry();
		employeeEntry9Employee1.setDate(new GregorianCalendar(2013,8,9));
		employeeEntry9Employee1.setHours(8);
		employeeEntry9Employee1.setCreativeHours(0);
		employeeEntry9Employee1.setCompanyCategory(companyCategory8);
		session.save(employeeEntry9Employee1);
		
		// NotepadEntries for EMPLOYEE2
		EmployeeEntry employeeEntry1Employee2 = new EmployeeEntry();
		employeeEntry1Employee2.setDate(new GregorianCalendar(2013,8,01));
		employeeEntry1Employee2.setHours(8);
		employeeEntry1Employee2.setCreativeHours(1);
		employeeEntry1Employee2.setCompanyCategory(companyCategory3);
		session.save(employeeEntry1Employee2);
		
		EmployeeEntry employeeEntry2Employee2 = new EmployeeEntry();
		employeeEntry2Employee2.setDate(new GregorianCalendar(2013,8,02));
		employeeEntry2Employee2.setHours(8);
		employeeEntry2Employee2.setCreativeHours(1);
		employeeEntry2Employee2.setCompanyCategory(companyCategory10);
		session.save(employeeEntry2Employee2);
		
		EmployeeEntry employeeEntry3Employee2 = new EmployeeEntry();
		employeeEntry3Employee2.setDate(new GregorianCalendar(2013,8,05));
		employeeEntry3Employee2.setHours(8);
		employeeEntry3Employee2.setCreativeHours(8);
		employeeEntry3Employee2.setCompanyCategory(companyCategory14);
		session.save(employeeEntry3Employee2);
		
		EmployeeEntry employeeEntry4Employee2 = new EmployeeEntry();
		employeeEntry4Employee2.setDate(new GregorianCalendar(2013,8,05));
		employeeEntry4Employee2.setHours(4);
		employeeEntry4Employee2.setCreativeHours(0);
		employeeEntry4Employee2.setCompanyCategory(companyCategory3);
		session.save(employeeEntry4Employee2);
		
		EmployeeEntry employeeEntry5Employee2 = new EmployeeEntry();
		employeeEntry5Employee2.setDate(new GregorianCalendar(2013,8,06));
		employeeEntry5Employee2.setHours(8);
		employeeEntry5Employee2.setCreativeHours(8);
		employeeEntry5Employee2.setCompanyCategory(companyCategory13);
		session.save(employeeEntry5Employee2);
		
		EmployeeEntry employeeEntry6Employee2 = new EmployeeEntry();
		employeeEntry6Employee2.setDate(new GregorianCalendar(2013,8,06));
		employeeEntry6Employee2.setHours(2);
		employeeEntry6Employee2.setCreativeHours(2);
		employeeEntry6Employee2.setCompanyCategory(companyCategory10);
		session.save(employeeEntry6Employee2);
		
		EmployeeEntry employeeEntry7Employee2 = new EmployeeEntry();
		employeeEntry7Employee2.setDate(new GregorianCalendar(2013,8,07));
		employeeEntry7Employee2.setHours(8);
		employeeEntry7Employee2.setCreativeHours(7);
		employeeEntry7Employee2.setCompanyCategory(companyCategory14);
		session.save(employeeEntry7Employee2);
		
		EmployeeEntry employeeEntry8Employee2 = new EmployeeEntry();
		employeeEntry8Employee2.setDate(new GregorianCalendar(2013,8,8));
		employeeEntry8Employee2.setHours(8);
		employeeEntry8Employee2.setCreativeHours(8);
		employeeEntry8Employee2.setCompanyCategory(companyCategory13);
		session.save(employeeEntry8Employee2);
		
		EmployeeEntry employeeEntry9Employee2 = new EmployeeEntry();
		employeeEntry9Employee2.setDate(new GregorianCalendar(2013,8,9));
		employeeEntry9Employee2.setHours(8);
		employeeEntry9Employee2.setCreativeHours(0);
		employeeEntry9Employee2.setCompanyCategory(companyCategory14);
		session.save(employeeEntry9Employee2);
		
		// NotepadEntries for EMPLOYEE3
		EmployeeEntry employeeEntry1Employee3 = new EmployeeEntry();
		employeeEntry1Employee3.setDate(new GregorianCalendar(2013,8,01));
		employeeEntry1Employee3.setHours(8);
		employeeEntry1Employee3.setCreativeHours(0);
		employeeEntry1Employee3.setCompanyCategory(companyCategory8);
		session.save(employeeEntry1Employee3);
		
		EmployeeEntry employeeEntry2Employee3 = new EmployeeEntry();
		employeeEntry2Employee3.setDate(new GregorianCalendar(2013,8,02));
		employeeEntry2Employee3.setHours(8);
		employeeEntry2Employee3.setCreativeHours(1);
		employeeEntry2Employee3.setCompanyCategory(companyCategory12);
		session.save(employeeEntry2Employee3);
		
		EmployeeEntry employeeEntry3Employee3 = new EmployeeEntry();
		employeeEntry3Employee3.setDate(new GregorianCalendar(2013,8,05));
		employeeEntry3Employee3.setHours(8);
		employeeEntry3Employee3.setCreativeHours(0);
		employeeEntry3Employee3.setCompanyCategory(companyCategory7);
		session.save(employeeEntry3Employee3);
		
		EmployeeEntry employeeEntry4Employee3 = new EmployeeEntry();
		employeeEntry4Employee3.setDate(new GregorianCalendar(2013,8,06));
		employeeEntry4Employee3.setHours(8);
		employeeEntry4Employee3.setCreativeHours(0);
		employeeEntry4Employee3.setCompanyCategory(companyCategory7);
		session.save(employeeEntry4Employee3);
		
		EmployeeEntry employeeEntry5Employee3 = new EmployeeEntry();
		employeeEntry5Employee3.setDate(new GregorianCalendar(2013,8,07));
		employeeEntry5Employee3.setHours(8);
		employeeEntry5Employee3.setCreativeHours(0);
		employeeEntry5Employee3.setCompanyCategory(companyCategory7);
		session.save(employeeEntry5Employee3);
		
		EmployeeEntry employeeEntry6Employee3 = new EmployeeEntry();
		employeeEntry6Employee3.setDate(new GregorianCalendar(2013,8,8));
		employeeEntry6Employee3.setHours(8);
		employeeEntry6Employee3.setCreativeHours(8);
		employeeEntry6Employee3.setCompanyCategory(companyCategory14);
		session.save(employeeEntry6Employee3);
		
		EmployeeEntry employeeEntry7Employee3 = new EmployeeEntry();
		employeeEntry7Employee3.setDate(new GregorianCalendar(2013,8,9));
		employeeEntry7Employee3.setHours(8);
		employeeEntry7Employee3.setCreativeHours(7);
		employeeEntry7Employee3.setCompanyCategory(companyCategory14);
		session.save(employeeEntry7Employee3);
		
		EmployeeEntry employeeEntry8Employee3 = new EmployeeEntry();
		employeeEntry8Employee3.setDate(new GregorianCalendar(2013,8,12));
		employeeEntry8Employee3.setHours(8);
		employeeEntry8Employee3.setCreativeHours(0);
		employeeEntry8Employee3.setCompanyCategory(companyCategory12);
		session.save(employeeEntry8Employee3);
		
		EmployeeEntry employeeEntry9Employee3 = new EmployeeEntry();
		employeeEntry9Employee3.setDate(new GregorianCalendar(2013,8,13));
		employeeEntry9Employee3.setHours(8);
		employeeEntry9Employee3.setCreativeHours(0);
		employeeEntry9Employee3.setCompanyCategory(companyCategory8);
		session.save(employeeEntry9Employee3);
		
		// NotepadEntries for EMPLOYEE4
		EmployeeEntry employeeEntry1Employee4 = new EmployeeEntry();
		employeeEntry1Employee4.setDate(new GregorianCalendar(2013,8,01));
		employeeEntry1Employee4.setHours(8);
		employeeEntry1Employee4.setCreativeHours(5);
		employeeEntry1Employee4.setCompanyCategory(companyCategory1);
		session.save(employeeEntry1Employee4);
		
		EmployeeEntry employeeEntry2Employee4 = new EmployeeEntry();
		employeeEntry2Employee4.setDate(new GregorianCalendar(2013,8,02));
		employeeEntry2Employee4.setHours(8);
		employeeEntry2Employee4.setCreativeHours(1);
		employeeEntry2Employee4.setCompanyCategory(companyCategory1);
		session.save(employeeEntry2Employee4);
		
		EmployeeEntry employeeEntry3Employee4 = new EmployeeEntry();
		employeeEntry3Employee4.setDate(new GregorianCalendar(2013,8,05));
		employeeEntry3Employee4.setHours(8);
		employeeEntry3Employee4.setCreativeHours(2);
		employeeEntry3Employee4.setCompanyCategory(companyCategory2);
		session.save(employeeEntry3Employee4);
		
		EmployeeEntry employeeEntry4Employee4 = new EmployeeEntry();
		employeeEntry4Employee4.setDate(new GregorianCalendar(2013,8,06));
		employeeEntry4Employee4.setHours(8);
		employeeEntry4Employee4.setCreativeHours(0);
		employeeEntry4Employee4.setCompanyCategory(companyCategory3);
		session.save(employeeEntry4Employee4);
		
		EmployeeEntry employeeEntry5Employee4 = new EmployeeEntry();
		employeeEntry5Employee4.setDate(new GregorianCalendar(2013,8,07));
		employeeEntry5Employee4.setHours(8);
		employeeEntry5Employee4.setCreativeHours(0);
		employeeEntry5Employee4.setCompanyCategory(companyCategory3);
		session.save(employeeEntry5Employee4);
		
		EmployeeEntry employeeEntry6Employee4 = new EmployeeEntry();
		employeeEntry6Employee4.setDate(new GregorianCalendar(2013,8,8));
		employeeEntry6Employee4.setHours(8);
		employeeEntry6Employee4.setCreativeHours(8);
		employeeEntry6Employee4.setCompanyCategory(companyCategory1);
		session.save(employeeEntry6Employee4);
		
		EmployeeEntry employeeEntry7Employee4 = new EmployeeEntry();
		employeeEntry7Employee4.setDate(new GregorianCalendar(2013,8,9));
		employeeEntry7Employee4.setHours(4);
		employeeEntry7Employee4.setCreativeHours(0);
		employeeEntry7Employee4.setCompanyCategory(companyCategory2);
		session.save(employeeEntry7Employee4);
		
		EmployeeEntry employeeEntry8Employee4 = new EmployeeEntry();
		employeeEntry8Employee4.setDate(new GregorianCalendar(2013,8,9));
		employeeEntry8Employee4.setHours(4);
		employeeEntry8Employee4.setCreativeHours(0);
		employeeEntry8Employee4.setCompanyCategory(companyCategory3);
		session.save(employeeEntry8Employee4);
		
		EmployeeEntry employeeEntry9Employee4 = new EmployeeEntry();
		employeeEntry9Employee4.setDate(new GregorianCalendar(2013,8,9));
		employeeEntry9Employee4.setHours(8);
		employeeEntry9Employee4.setCreativeHours(0);
		employeeEntry9Employee4.setCompanyCategory(companyCategory8);
		session.save(employeeEntry9Employee4);
		/*
		 * END OF -------------- NOTEPAD ENTRY
		 */
		
		
		/*
		 * EMPLOYEE 1st
		 */
		Employee employee1 = new Employee();
		employee1.setEmail("bartosz.szewczyk.81@gmail.com");
		employee1.setFirst_name("Bartosz");
		employee1.setLast_name("Szewczyk");
		employee1.setLogin("lute");
		employee1.setRole(roleEmployee);
		session.save(employee1);
		
		
		Employee employee2 = new Employee();
		employee2.setEmail("mietek@gmail.com");
		employee2.setFirst_name("Mietek");
		employee2.setLast_name("Pracus");
		employee2.setLogin("mietek");
		employee2.setRole(roleEmployee);
		session.save(employee2);
			
		Employee employee3 = new Employee();
		employee3.setEmail("kuba@gmail.com");
		employee3.setFirst_name("Kuba");
		employee3.setLast_name("Urlopowicz");
		employee3.setLogin("qba");
		employee3.setRole(roleEmployee);
		session.save(employee3);

		Employee employee4 = new Employee();
		employee4.setEmail("hirek@gmail.com");
		employee4.setFirst_name("Hieronim");
		employee4.setLast_name("Wycieczka");
		employee4.setLogin("hihi");
		employee4.setRole(roleEmployee);
		session.save(employee4);
		/*
		 * END OF -------------- EMPLOYEE
		 */
			
		/*
		 * APPROVER
		 */
		Approver approver1 = new Approver();
		approver1.setEmail("bbb@bbb.bbb");
		approver1.setFirst_name("Krzysztof");
		approver1.setLast_name("Zatwierdzajacy");
		approver1.setLogin("app");
		approver1.setRole(roleApprover);
		approver1.getEmployees().add(employee1);
		approver1.getEmployees().add(employee2);
			
		Approver approver2 = new Approver();
		approver2.setEmail("aaa@aaa.aaa");
		approver2.setFirst_name("Czesio");
		approver2.setLast_name("Zatwierdzacz");
		approver2.setLogin("czes");
		approver2.setRole(roleApprover);
		approver2.getEmployees().add(employee3);
		approver2.getEmployees().add(employee4);
		approver2.setReplacement(approver1);

		approver1.setReplacement(approver2);
		approver2.setReplacement(approver1);
		
		session.save(approver2);
		session.save(approver1);
		/*
		 * END OF -------------- APPROVER
		 */
		
		//SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd");
		SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
		GregorianCalendar cal = new GregorianCalendar();
		dateFormater.setCalendar(cal);
			
		/*
		 * EMPLOYEE ACCOUNTING PERIOD
		 */
		EmployeeAccountingPeriod eAccPeriod1 = new EmployeeAccountingPeriod();
		eAccPeriod1.getEmployeeEntries().add(employeeEntry1Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry2Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry3Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry4Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry5Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry6Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry7Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry8Employee1);
		eAccPeriod1.getEmployeeEntries().add(employeeEntry9Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry1Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry2Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry3Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry4Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry5Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry6Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry7Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry8Employee1);
		eAccPeriod1.getNotepadEntries().add(notepadEntry9Employee1);
		
		EmployeeAccountingPeriod eAccPeriod2 = new EmployeeAccountingPeriod();
		eAccPeriod2.getEmployeeEntries().add(employeeEntry1Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry2Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry3Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry4Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry5Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry6Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry7Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry8Employee2);
		eAccPeriod2.getEmployeeEntries().add(employeeEntry9Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry1Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry2Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry3Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry4Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry5Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry6Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry7Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry8Employee2);
		eAccPeriod2.getNotepadEntries().add(notepadEntry9Employee2);

		EmployeeAccountingPeriod eAccPeriod3 = new EmployeeAccountingPeriod();
		eAccPeriod3.getEmployeeEntries().add(employeeEntry1Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry2Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry3Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry4Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry5Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry6Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry7Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry8Employee3);
		eAccPeriod3.getEmployeeEntries().add(employeeEntry9Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry1Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry2Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry3Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry4Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry5Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry6Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry7Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry8Employee3);
		eAccPeriod3.getNotepadEntries().add(notepadEntry9Employee3);

		EmployeeAccountingPeriod eAccPeriod4 = new EmployeeAccountingPeriod();
		eAccPeriod4.getEmployeeEntries().add(employeeEntry1Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry2Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry3Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry4Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry5Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry6Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry7Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry8Employee4);
		eAccPeriod4.getEmployeeEntries().add(employeeEntry9Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry1Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry2Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry3Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry4Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry5Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry6Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry7Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry8Employee4);
		eAccPeriod4.getNotepadEntries().add(notepadEntry9Employee4);
			
		EmployeeAccountingPeriod eAccPeriod5 = new EmployeeAccountingPeriod();
		eAccPeriod5.getEmployeeEntries().add(employeeEntry1Employee1);
		eAccPeriod5.getEmployeeEntries().add(employeeEntry2Employee1);
		eAccPeriod5.getEmployeeEntries().add(employeeEntry3Employee2);
		eAccPeriod5.getEmployeeEntries().add(employeeEntry4Employee2);
		eAccPeriod5.getEmployeeEntries().add(employeeEntry5Employee3);
		eAccPeriod5.getEmployeeEntries().add(employeeEntry6Employee3);
		eAccPeriod5.getEmployeeEntries().add(employeeEntry7Employee4);
		eAccPeriod5.getEmployeeEntries().add(employeeEntry8Employee4);
		eAccPeriod5.getNotepadEntries().add(notepadEntry1Employee1);
		eAccPeriod5.getNotepadEntries().add(notepadEntry2Employee1);
		eAccPeriod5.getNotepadEntries().add(notepadEntry3Employee2);
		eAccPeriod5.getNotepadEntries().add(notepadEntry4Employee2);
		eAccPeriod5.getNotepadEntries().add(notepadEntry5Employee3);
		eAccPeriod5.getNotepadEntries().add(notepadEntry6Employee3);
		eAccPeriod5.getNotepadEntries().add(notepadEntry7Employee4);
		eAccPeriod5.getNotepadEntries().add(notepadEntry8Employee4);

		EmployeeAccountingPeriod eAccPeriod6 = new EmployeeAccountingPeriod();
		eAccPeriod6.getEmployeeEntries().add(employeeEntry1Employee1);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry2Employee2);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry3Employee3);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry4Employee4);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry5Employee1);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry6Employee2);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry7Employee3);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry8Employee4);
		eAccPeriod6.getEmployeeEntries().add(employeeEntry9Employee4);
		eAccPeriod6.getNotepadEntries().add(notepadEntry1Employee1);
		eAccPeriod6.getNotepadEntries().add(notepadEntry2Employee2);
		eAccPeriod6.getNotepadEntries().add(notepadEntry3Employee3);
		eAccPeriod6.getNotepadEntries().add(notepadEntry4Employee4);
		eAccPeriod6.getNotepadEntries().add(notepadEntry5Employee1);
		eAccPeriod6.getNotepadEntries().add(notepadEntry6Employee2);
		eAccPeriod6.getNotepadEntries().add(notepadEntry7Employee3);
		eAccPeriod6.getNotepadEntries().add(notepadEntry8Employee4);
		eAccPeriod6.getNotepadEntries().add(notepadEntry9Employee4);
		
		eAccPeriod1.setApprover(null);
		eAccPeriod1.setEmployee(employee1);
		eAccPeriod1.setCalendarApprover(approver1.getId_user());
		eAccPeriod1.setRejectedBy(null);
		eAccPeriod1.setEmployeeAccountingPeriodState(EmployeeAccountingPeriodState.REJECTED_BY_APPROVER.toString());
		eAccPeriod1.setRejectionDate(new GregorianCalendar());
		eAccPeriod1.setRejectionReason("fix entries for the rest of month, mate");
		eAccPeriod1.setRejectedByUserRole(approver1.getRole().getName());
		eAccPeriod1.setCalFrom(new GregorianCalendar(2013,01,01));
		employee1.getEmployeeAccountingPeriods().add(eAccPeriod1);

		eAccPeriod2.setApprover(null);
		eAccPeriod2.setEmployee(employee2);
		eAccPeriod2.setRejectedBy(null);
		eAccPeriod2.setEmployeeAccountingPeriodState(EmployeeAccountingPeriodState.REJECTED_BY_APPROVER.toString());
		eAccPeriod2.setRejectionDate(new GregorianCalendar());
		eAccPeriod2.setRejectionReason("fix entries for the rest of month, mate");
		eAccPeriod2.setRejectedByUserRole(approver2.getRole().getName());
		eAccPeriod2.setCalFrom(new GregorianCalendar(2013,02,01));
		employee2.getEmployeeAccountingPeriods().add(eAccPeriod2);

		eAccPeriod3.setApprover(null);
		eAccPeriod3.setEmployee(employee3);
		eAccPeriod3.setCalendarApprover(approver2.getId_user());
		eAccPeriod3.setRejectedBy(null);
		eAccPeriod3.setEmployeeAccountingPeriodState(EmployeeAccountingPeriodState.CHECKED_BY_APPROVER.toString());
		eAccPeriod3.setRejectionDate(null);
		eAccPeriod3.setRejectionReason(null);
		eAccPeriod3.setRejectedByUserRole(null);
		eAccPeriod3.setCalFrom(new GregorianCalendar(2013,03,01));
		employee3.getEmployeeAccountingPeriods().add(eAccPeriod3);

		eAccPeriod4.setApprover(null);
		eAccPeriod4.setEmployee(employee4);
		eAccPeriod4.setRejectedBy(null);
		eAccPeriod4.setEmployeeAccountingPeriodState(EmployeeAccountingPeriodState.CHECKED_BY_APPROVER.toString());
		eAccPeriod4.setRejectionDate(null);
		eAccPeriod4.setRejectionReason(null);
		eAccPeriod4.setRejectedByUserRole(null);
		eAccPeriod4.setCalFrom(new GregorianCalendar(2013,04,01));
		employee4.getEmployeeAccountingPeriods().add(eAccPeriod4);

		eAccPeriod5.setApprover(approver1);
		eAccPeriod5.setEmployee(null);
		eAccPeriod5.setRejectedBy(null);
		eAccPeriod5.setEmployeeAccountingPeriodState(EmployeeAccountingPeriodState.CHECKED_BY_CLIENT_ADMIN.toString());
		eAccPeriod5.setRejectionDate(null);
		eAccPeriod5.setRejectionReason(null);
		eAccPeriod5.setRejectedByUserRole(null);
		eAccPeriod4.setCalFrom(new GregorianCalendar(2013,05,01));
		approver1.getApproverAccountingPeriods().add(eAccPeriod5);
		
		eAccPeriod6.setApprover(approver2);
		eAccPeriod6.setEmployee(null);
		eAccPeriod6.setRejectedBy(null);
		eAccPeriod6.setEmployeeAccountingPeriodState(EmployeeAccountingPeriodState.CHECKED_BY_CLIENT_ADMIN.toString());
		eAccPeriod6.setRejectionDate(null);
		eAccPeriod6.setRejectionReason(null);
		eAccPeriod6.setRejectedByUserRole(null);
		eAccPeriod6.setCalFrom(new GregorianCalendar(2013,06,01));
		approver2.getApproverAccountingPeriods().add(eAccPeriod6);
		
		session.save(eAccPeriod1);
		session.save(eAccPeriod2);
		session.save(eAccPeriod3);
		session.save(eAccPeriod4);
		session.save(eAccPeriod5);
		session.save(eAccPeriod6);
		session.save(employee1);
		session.save(employee2);
		session.save(employee3);
		session.save(employee4);
		/*
		 * END OF -------------- EMPLOYEE ACCOUNTING PERIOD
		 */

		
		/*
		 * END OF -------------- EMPLOYEE ACCOUNTING PERIOD + EMPLOYEE
		 */
		EmployeeProfile employeeProfile1 = new EmployeeProfile();
		employeeProfile1.setEmployee(employee1);
		employeeProfile1.setApprover(null);
		employeeProfile1.setClient(client1);
		employeeProfile1.setBusinessUnit(businessUnit1);
		employeeProfile1.setEmail(employee1.getEmail());
		employeeProfile1.setPositions(position1);
		employeeProfile1.setEmploymentStatus(EmploymentStatusCategories.EMPLOYMENT_CONTRACT.toString());
		employeeProfile1.setBillingStartDate(new GregorianCalendar(2013,8,01));
		employeeProfile1.setBackgroundCheck(new GregorianCalendar(2013,07,31));
		employeeProfile1.setEmployeeCurrentState(EmployeeCurrentState.WORKING_FOR_CLIENT.toString());
		employeeProfile1.setStartWorking(new GregorianCalendar(2013,06,01));
		employeeProfile1.setWorkLifeLine(new GregorianCalendar(2013,07,01));
		employee1.setEmployeeProfil(employeeProfile1);
		
		EmployeeProfile employeeProfile2 = new EmployeeProfile();
		employeeProfile2.setEmployee(employee2);
		employeeProfile2.setApprover(null);
		employeeProfile2.setClient(client1);
		employeeProfile2.setBusinessUnit(businessUnit3);
		employeeProfile2.setEmail(employee2.getEmail());
		employeeProfile2.setPositions(position2);
		employeeProfile2.setEmploymentStatus(EmploymentStatusCategories.EMPLOYMENT_CONTRACT.toString());
		employeeProfile2.setBillingStartDate(new GregorianCalendar(2013,01,01));
		employeeProfile2.setBackgroundCheck(new GregorianCalendar(2013,03,31));
		employeeProfile2.setEmployeeCurrentState(EmployeeCurrentState.WORKING_FOR_CLIENT.toString());
		employeeProfile2.setStartWorking(new GregorianCalendar(2012,12,01));
		employeeProfile2.setWorkLifeLine(new GregorianCalendar(2013,12,15));
		employee2.setEmployeeProfil(employeeProfile2);
		
		
		
		EmployeeProfile employeeProfile3 = new EmployeeProfile();
		employeeProfile3.setEmployee(employee3);
		employeeProfile3.setApprover(null);
		employeeProfile3.setClient(client3);
		employeeProfile3.setBusinessUnit(businessUnit6);
		employeeProfile3.setEmail(employee3.getEmail());
		employeeProfile3.setPositions(position3);
		employeeProfile3.setEmploymentStatus(EmploymentStatusCategories.EMPLOYMENT_CONTRACT.toString());
		employeeProfile3.setBillingStartDate(new GregorianCalendar(2013,02,01));
		employeeProfile3.setBackgroundCheck(new GregorianCalendar(2013,02,24));
		employeeProfile3.setEmployeeCurrentState(EmployeeCurrentState.WORKING_FOR_CLIENT.toString());
		employeeProfile3.setStartWorking(new GregorianCalendar(2012,01,01));
		employeeProfile3.setWorkLifeLine(new GregorianCalendar(2013,01,15));
		employee3.setEmployeeProfil(employeeProfile3);
		
		
		
		EmployeeProfile employeeProfile4 = new EmployeeProfile();
		employeeProfile4.setEmployee(employee4);
		employeeProfile4.setApprover(null);
		employeeProfile4.setClient(client4);
		employeeProfile4.setBusinessUnit(businessUnit9);
		employeeProfile4.setEmail(employee3.getEmail());
		employeeProfile4.setPositions(position4);
		employeeProfile4.setEmploymentStatus(EmploymentStatusCategories.EMPLOYMENT_CONTRACT.toString());
		employeeProfile4.setBillingStartDate(new GregorianCalendar(2013,05,10));
		employeeProfile4.setBackgroundCheck(new GregorianCalendar(2013,06,24));
		employeeProfile4.setEmployeeCurrentState(EmployeeCurrentState.WORKING_FOR_CLIENT.toString());
		employeeProfile4.setStartWorking(new GregorianCalendar(2012,04,01));
		employeeProfile4.setWorkLifeLine(new GregorianCalendar(2013,04,21));
		employee4.setEmployeeProfil(employeeProfile4);

		EmployeeProfile approverProfile1 = new EmployeeProfile();
		approverProfile1.setEmployee(null);
		approverProfile1.setApprover(approver1);
		approverProfile1.setClient(client1);
		approverProfile1.setBusinessUnit(businessUnit2);
		approverProfile1.setEmail(approver1.getEmail());
		approverProfile1.setPositions(position3);
		approverProfile1.setEmploymentStatus(EmploymentStatusCategories.EMPLOYMENT_CONTRACT.toString());
		approverProfile1.setBillingStartDate(new GregorianCalendar(2012,05,10));
		approverProfile1.setBackgroundCheck(new GregorianCalendar(2012,07,24));
		approverProfile1.setEmployeeCurrentState(EmployeeCurrentState.WORKING_FOR_CLIENT.toString());
		approverProfile1.setStartWorking(new GregorianCalendar(2012,04,01));
		approverProfile1.setWorkLifeLine(new GregorianCalendar(2012,05,21));
		approver1.setApproverProfile(approverProfile1);

		EmployeeProfile approverProfile2 = new EmployeeProfile();
		approverProfile2.setEmployee(null);
		approverProfile2.setApprover(approver2);
		approverProfile2.setClient(client2);
		approverProfile2.setBusinessUnit(businessUnit4);
		approverProfile2.setEmail(approver2.getEmail());
		approverProfile2.setPositions(position3);
		approverProfile2.setEmploymentStatus(EmploymentStatusCategories.EMPLOYMENT_CONTRACT.toString());
		approverProfile2.setBillingStartDate(new GregorianCalendar(2012,04,10));
		approverProfile2.setBackgroundCheck(new GregorianCalendar(2012,06,24));
		approverProfile2.setEmployeeCurrentState(EmployeeCurrentState.WORKING_FOR_CLIENT.toString());
		approverProfile2.setStartWorking(new GregorianCalendar(2012,04,01));
		approverProfile2.setWorkLifeLine(new GregorianCalendar(2012,05,10));
		approver2.setApproverProfile(approverProfile2);
		
		
		session.save(approverProfile1);
		session.save(approverProfile2);
		session.save(employeeProfile1);
		session.save(employeeProfile2);
		session.save(employeeProfile3);
		session.save(employeeProfile4);
		session.save(employee1);
		session.save(employee2);
		session.save(employee3);
		session.save(employee4);
		/*
		 * END OF -------------- EMPLOYEE ACCOUNTING PERIOD + EMPLOYEE
		 */

		
		
		/*
		 * APPROVER
		 */
		approver1.getEmployees().add(employee1);
		approver1.getEmployees().add(employee4);
		approver2.getEmployees().add(employee2);
		approver2.getEmployees().add(employee3);
		
		approver1.getApproverAccountingPeriods().add(eAccPeriod1);
		approver1.getApproverAccountingPeriods().add(eAccPeriod2);
		approver1.getApproverAccountingPeriods().add(eAccPeriod5);
		approver2.getApproverAccountingPeriods().add(eAccPeriod3);
		approver2.getApproverAccountingPeriods().add(eAccPeriod4);
		approver2.getApproverAccountingPeriods().add(eAccPeriod6);
		
		session.save(approver1);
		session.save(approver2);
		/*
		 * END OF -------------- APPROVER
		 */
		
		
		/*
		 * CLIENT + CLIENT PROFILE
		 */
		
		ClientProfile clientProfile1 = new ClientProfile();
		clientProfile1.setClient(client1);
		clientProfile1.getClientAdmin().add(clientAdmin1);
		clientProfile1.getClientAdmin().add(clientAdmin3);
		clientProfile1.getClientCategories().add(clientCatBusinessTrip);
		clientProfile1.getClientCategories().add(clientCatContractorTimeOff);
		clientProfile1.getClientCategories().add(clientCatNormalTime);
		clientProfile1.getClientCategories().add(clientCatOverTime);
		clientProfile1.getClientCategories().add(clientCatTraining);
		clientProfile1.setSendMailRemainder(new GregorianCalendar(2013,8,25));
		clientProfile1.setDeadlineToCloseAccountingPeriod(new GregorianCalendar(2013,8,31));
		client1.setClientProfil(clientProfile1);

		ClientProfile clientProfile2 = new ClientProfile();
		clientProfile2.setClient(client2);
		clientProfile2.getClientAdmin().add(clientAdmin1);
		clientProfile2.getClientCategories().add(clientCatBusinessTrip);
		clientProfile2.getClientCategories().add(clientCatContractorTimeOff);
		clientProfile2.getClientCategories().add(clientCatNormalTime);
		clientProfile2.getClientCategories().add(clientCatOverTime);
		clientProfile2.getClientCategories().add(clientCatTraining);
		clientProfile2.setSendMailRemainder(new GregorianCalendar(2013,8,25));
		clientProfile2.setDeadlineToCloseAccountingPeriod(new GregorianCalendar(2013,8,31));
		client2.setClientProfil(clientProfile2);

		ClientProfile clientProfile3 = new ClientProfile();
		clientProfile3.setClient(client3);
		clientProfile3.getClientAdmin().add(clientAdmin1);
		clientProfile3.getClientAdmin().add(clientAdmin2);
		clientProfile3.getClientCategories().add(clientCatBusinessTrip);
		clientProfile3.getClientCategories().add(clientCatContractorTimeOff);
		clientProfile3.getClientCategories().add(clientCatNormalTime);
		clientProfile3.getClientCategories().add(clientCatOverTime);
		clientProfile3.getClientCategories().add(clientCatTraining);
		clientProfile3.setSendMailRemainder(new GregorianCalendar(2013,8,25));
		clientProfile3.setDeadlineToCloseAccountingPeriod(new GregorianCalendar(2013,8,31));
		client3.setClientProfil(clientProfile3);

		ClientProfile clientProfile4 = new ClientProfile();
		clientProfile4.setClient(client4);
		clientProfile4.getClientAdmin().add(clientAdmin2);
		clientProfile4.getClientCategories().add(clientCatBusinessTrip);
		clientProfile4.getClientCategories().add(clientCatContractorTimeOff);
		clientProfile4.getClientCategories().add(clientCatNormalTime);
		clientProfile4.getClientCategories().add(clientCatOverTime);
		clientProfile4.getClientCategories().add(clientCatTraining);
		clientProfile4.setSendMailRemainder(new GregorianCalendar(2013,8,25));
		clientProfile4.setDeadlineToCloseAccountingPeriod(new GregorianCalendar(2013,8,31));
		client4.setClientProfil(clientProfile4);

		ClientProfile clientProfile5 = new ClientProfile();
		clientProfile5.setClient(client5);
		clientProfile5.getClientAdmin().add(clientAdmin3);
		clientProfile5.getClientCategories().add(clientCatBusinessTrip);
		clientProfile5.getClientCategories().add(clientCatContractorTimeOff);
		clientProfile5.getClientCategories().add(clientCatNormalTime);
		clientProfile5.getClientCategories().add(clientCatOverTime);
		clientProfile5.getClientCategories().add(clientCatTraining);
		clientProfile5.setSendMailRemainder(new GregorianCalendar(2013,8,25));
		clientProfile5.setDeadlineToCloseAccountingPeriod(new GregorianCalendar(2013,8,31));
		client5.setClientProfil(clientProfile5);
		
		session.save(clientProfile1);
		session.save(clientProfile2);
		session.save(clientProfile3);
		session.save(clientProfile4);
		session.save(clientProfile5);
		session.save(client1);
		session.save(client2);
		session.save(client3);
		session.save(client4);
		session.save(client5);
		/*
		 * END OF -------------- CLIENT ADMIN
		 */

		ClientAccountingPeriod cAccPeriod1 = new ClientAccountingPeriod();
		cAccPeriod1.setClient(client1);
		cAccPeriod1.setClientAccountingPeriodState(ClientAccountingPeriodState.OPEN.toString());
		cAccPeriod1.getEmployeeAccountingPeriod().add(eAccPeriod1);
		cAccPeriod1.setDate_from(new GregorianCalendar(2013,8,01));
		cAccPeriod1.setDate_to(new GregorianCalendar(2013,8,30));
		client1.getClientAccountingPeriods().add(cAccPeriod1);
		eAccPeriod1.setClientAccountingPeriod(cAccPeriod1);

		ClientAccountingPeriod cAccPeriod2 = new ClientAccountingPeriod();
		cAccPeriod2.setClient(client2);
		cAccPeriod2.setClientAccountingPeriodState(ClientAccountingPeriodState.OPEN.toString());
		cAccPeriod2.getEmployeeAccountingPeriod().add(eAccPeriod2);
		cAccPeriod2.setDate_from(new GregorianCalendar(2013,8,01));
		cAccPeriod2.setDate_to(new GregorianCalendar(2013,8,30));
		client2.getClientAccountingPeriods().add(cAccPeriod2);
		eAccPeriod2.setClientAccountingPeriod(cAccPeriod2);

		ClientAccountingPeriod cAccPeriod3 = new ClientAccountingPeriod();
		cAccPeriod3.setClient(client3);
		cAccPeriod3.setClientAccountingPeriodState(ClientAccountingPeriodState.OPEN.toString());
		cAccPeriod3.getEmployeeAccountingPeriod().add(eAccPeriod3);
		cAccPeriod3.setDate_from(new GregorianCalendar(2013,8,01));
		cAccPeriod3.setDate_to(new GregorianCalendar(2013,8,30));
		client3.getClientAccountingPeriods().add(cAccPeriod3);
		eAccPeriod3.setClientAccountingPeriod(cAccPeriod3);

		ClientAccountingPeriod cAccPeriod4 = new ClientAccountingPeriod();
		cAccPeriod4.setClient(client4);
		cAccPeriod4.setClientAccountingPeriodState(ClientAccountingPeriodState.OPEN.toString());
		cAccPeriod4.getEmployeeAccountingPeriod().add(eAccPeriod4);
		cAccPeriod4.setDate_from(new GregorianCalendar(2013,8,01));
		cAccPeriod4.setDate_to(new GregorianCalendar(2013,8,30));
		client4.getClientAccountingPeriods().add(cAccPeriod4);
		eAccPeriod4.setClientAccountingPeriod(cAccPeriod4);

		ClientAccountingPeriod cAccPeriod5 = new ClientAccountingPeriod();
		cAccPeriod5.setClient(client5);
		cAccPeriod5.setClientAccountingPeriodState(ClientAccountingPeriodState.OPEN.toString());
		cAccPeriod5.getEmployeeAccountingPeriod().add(eAccPeriod5);
		cAccPeriod5.setDate_from(new GregorianCalendar(2013,8,01));
		cAccPeriod5.setDate_to(new GregorianCalendar(2013,8,30));
		client5.getClientAccountingPeriods().add(cAccPeriod5);
		eAccPeriod5.setClientAccountingPeriod(cAccPeriod5);

		ClientAccountingPeriod cAccPeriod6 = new ClientAccountingPeriod();
		cAccPeriod6.setClient(client5);
		cAccPeriod6.setClientAccountingPeriodState(ClientAccountingPeriodState.CLOSE.toString());
		cAccPeriod6.getEmployeeAccountingPeriod().add(eAccPeriod6);
		cAccPeriod6.getEmployeeAccountingPeriod().add(eAccPeriod5);
		cAccPeriod6.setDate_from(new GregorianCalendar(2013,7,01));
		cAccPeriod6.setDate_to(new GregorianCalendar(2013,7,31));
		client5.getClientAccountingPeriods().add(cAccPeriod6);
		eAccPeriod6.setClientAccountingPeriod(cAccPeriod6);
		
			
		session.save(cAccPeriod1);
		session.save(cAccPeriod2);
		session.save(cAccPeriod3);
		session.save(cAccPeriod4);
		session.save(cAccPeriod5);
		session.save(cAccPeriod6);
		session.save(eAccPeriod1);
		session.save(eAccPeriod2);
		session.save(eAccPeriod3);
		session.save(eAccPeriod4);
		session.save(eAccPeriod5);
		session.save(eAccPeriod6);
		session.save(client1);
		session.save(client2);
		session.save(client3);
		session.save(client4);
		session.save(client5);
		
		session.getTransaction().commit();
	}
}
